package com.xy.model;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Cacheable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.Cascade;
import org.hibernate.annotations.CascadeType;

/*
 * @货架表
 */
@SuppressWarnings("serial")
@Entity
@Table
@Cacheable
public class Cell extends Identified implements Serializable {
	@Column(nullable = false)
	private String name;// 货架名称
	private String remark; // 备注
	// 对应到教材表
	@OneToMany(targetEntity = TextBook.class, mappedBy = "cell")
	private Set<TextBook> textBooks = new HashSet<TextBook>();
	// 对应到库存盘点
	@OneToMany(targetEntity = StockCheck.class, mappedBy = "cell")
	private Set<StockCheck> stockChecks = new HashSet<StockCheck>();
	// 对应到库存表
	@OneToMany(targetEntity = StockSelect.class, mappedBy = "cell")
	private Set<StockSelect> stockSelect;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public Set<TextBook> getTextBooks() {
		return textBooks;
	}

	public void setTextBooks(Set<TextBook> textBooks) {
		this.textBooks = textBooks;
	}

	public Set<StockCheck> getStockChecks() {
		return stockChecks;
	}

	public void setStockChecks(Set<StockCheck> stockChecks) {
		this.stockChecks = stockChecks;
	}

	public Set<StockSelect> getStockSelect() {
		return stockSelect;
	}

	public void setStockSelect(Set<StockSelect> stockSelect) {
		this.stockSelect = stockSelect;
	}

	public Cell() {
		super();
		// TODO Auto-generated constructor stub
	}

}
